<?php
// ------------------------------------------------------------------------
// |@Author       : Jarmin <edshop@qq.com>
// |@----------------------------------------------------------------------
// |@Date         : 2023-07-04 15:24:30
// |@----------------------------------------------------------------------
// |@LastEditTime : 2023-07-04 15:24:32
// |@----------------------------------------------------------------------
// |@LastEditors  : Jarmin <jarmin@ladmin.cn>
// |@----------------------------------------------------------------------
// |@Description  : 
// |@----------------------------------------------------------------------
// |@FilePath     : Login.php
// |@----------------------------------------------------------------------
// |@Copyright (c) 2023 http://www.ladmin.cn   All rights reserved. 
// ------------------------------------------------------------------------
namespace app\login\validate;

use think\Validate;

/**
 * 登陆验证类，用于实现登陆相关的验证操作。
 */
class Login extends Validate
{
    protected $rule =   [
        'username'             => 'require|max:50',
        'password'             => 'require|max:32',
    ];
    
    protected $message  =   [
        'name.require'         => 'user.name_require',
        'name.max'             => 'user.name_max',
        'username.require'     => 'user.username_require',
        'username.max'         => 'user.username_max',
        'password.require'     => 'user.password_require',
        'password.max'         => 'user.password_max'
    ];

    // login 验证场景定义
    public function sceneLogin()
    {
    	return $this->only(['username', 'password']);
    }
}